from django.conf.urls.defaults import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.conf import settings
import settings

admin.autodiscover()

urlpatterns = patterns('',
    #(r'^media/(P?<path>.*)$', 'django.views.static.serve', { 'document_root' : settings.MEDIA_ROOT }),
    # Examples:
    # url(r'^$', 'WEPO_verkefni3.views.home', name='home'),
    # url(r'^WEPO_verkefni3/', include('WEPO_verkefni3.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),

    url(r'^$', 'verkefni3.views.home'),
    url(r'^Student/', 'verkefni3.views.studend_home'),
    url(r'^Teacher/', 'verkefni3.views.exams_home'),
    url(r'^CreateExam/', 'verkefni3.views.create_exam'),
    url(r'^AllExams/', 'verkefni3.views.all_exams'),
    url(r'^FinishedExams/', 'verkefni3.views.finished_exams'),
    url(r'^CurrentExams/', 'verkefni3.views.current_exams'),
    url(r'^EditExam/(?P<exam_id>\d+)','verkefni3.views.edit_exams'),
    url(r'^DeleteExam/(?P<exam_id>\d+)', 'verkefni3.views.delete_exams'),
    url(r'^Exam/(?P<exam_id>\d+)', 'verkefni3.views.detail_exams'),
    url(r'^Exam/Question/(?P<exam_id>\d+)', 'verkefni3.views.detail_question'),
    url(r'^AvailableExams/', 'verkefni3.views.student_current_exams'),
    url(r'^ClosedExams/', 'verkefni3.views.student_finished_exams'),
    url(r'^OngoingExams/', 'verkefni3.views.student_ongoing_exams'),
    url(r'^StudentExam/(?P<exam_id>\d+)', 'verkefni3.views.student_taking_exam'),
    url(r'^OngoingStudentExam/(?P<exam_id>\d+)', 'verkefni3.views.student_taking_exam'),
    url(r'^AddQuestion$','verkefni3.views.add_question'),


    url(r'^DeleteAnswer$','verkefni3.views.delete_answer'),
    url(r'^EditAnswerSave$','verkefni3.views.edit_answer_save'),
    url(r'^EditAnswer$','verkefni3.views.edit_answer'),
    url(r'^AddAnswer$','verkefni3.views.add_answer'),
    url(r'^AddQuestion$','verkefni3.views.add_question'),
    url(r'^DeleteQuestion$','verkefni3.views.delete_question'),
    url(r'^EditQuestion$','verkefni3.views.edit_question'),
    url(r'^EditQuestionSave$','verkefni3.views.edit_question_save'),


    #url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'myapp/login.html'}),
    url(r'^accounts/login/$', 'django.contrib.auth.views.login'),
    url(r'^accounts/logout/$', 'django.contrib.auth.views.logout'),



    # url(r'^test/', 'verkefni3.views.exams_test'),
    # url(r'^test2/', 'verkefni3.views.exams_test2'),

)
